package com.example.demo.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

@Entity
public class Serveway {
    private int swId;
    private String swTypeName;
    private List<Serve> fw;


    @Id
    @Column(name = "sw_ID", nullable = false)
    public int getSwId() {
        return swId;
    }

    public void setSwId(int swId) {
        this.swId = swId;
    }

    @Basic
    @Column(name = "sw_typeName", nullable = true, length = 255)
    public String getSwTypeName() {
        return swTypeName;
    }

    public void setSwTypeName(String swTypeName) {
        this.swTypeName = swTypeName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Serveway serveway = (Serveway) o;
        return swId == serveway.swId &&
                Objects.equals(swTypeName, serveway.swTypeName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(swId, swTypeName);
    }

    @OneToMany(mappedBy = "fwfs")
    public List<Serve> getFw() {
        return fw;
    }

    public void setFw(List<Serve> fw) {
        this.fw = fw;
    }
}
